<?php
    require_once( "common.inc.php" );

    $captchaGenerator = new CaptchaGenerator();
    $captchaCode = $captchaGenerator->GenerateCode( 4 );
    Session::SetValue( "public_key", $captchaCode );

    $width = Util::GetCorrectString( "width", 120 );
    $height= Util::GetCorrectString( "height", 40 );
    
    $captchaGenerator->fontsDirectory = CAPTCHA_TTF;
    $captchaPrivateCode = $captchaGenerator->GeneratePrivateCode( $captchaCode );
    $captchaGenerator->GenerateAndOutputImage( $captchaPrivateCode, $width, $height );
?>